﻿using System;
using System.Runtime.Serialization;

namespace CapstoneProjectAEReader.Entities.Models
{
    [Serializable()]
    public class Note : ISerializable
    {
        private int _noteId;
        private string _noteContent;
        private string _description;

        public Note()
        {

        }
        public int NoteId
        {
            get { return _noteId; }
            set { _noteId = value; }
        }

        public string Description
        {
            get { return _description; }
            set { _description = value; }
        }

        public string NoteContent
        {
            get { return _noteContent; }
            set { _noteContent = value; }
        }

        // Serialize
        public Note(SerializationInfo info, StreamingContext ctxt)
        {
            _noteId = (int)info.GetValue("NoteId", typeof(int));
            _noteContent = (string) info.GetValue("NoteContent", typeof (string));
            _description = (string)info.GetValue("Description", typeof(string));
        }

        public void GetObjectData(SerializationInfo info, StreamingContext ctxt)
        {
            info.AddValue("NoteId", _noteId);
            info.AddValue("NoteContent", _noteContent);
            info.AddValue("Description", _description);
        }
    }
}
